from celery import Celery
import time
import os
import ansible_runner
import re
from datetime import timedelta



broker = 'redis://192.168.139.130:6379/1'
backend = 'redis://192.168.139.130:6379/2'
app = Celery(broker=broker, backend=backend,include=['celery_task.crawima_task','celery_task.user_task',
                                                     'celery_task.order'])


# app.conf.timezone='Asia/Shanghai'
# app.conf.enable_utc=True
#
# app.conf.beat_schedule = {
#     'ansible-task': {
#            'task': 'celery_task.order.run_playbook_with_cert',
#            'schedule': timedelta(seconds=60),
#            'args': ('/root/test/deploy.yaml','/root/test/hosts.ini'),
#      }
# }